<?php
/**
 * 订单商品模型
 * @author maniac
 */
namespace app\common\model;

class OrderGoods extends Base
{
    protected $table = "maniac_order_goods";
    protected $createTime = "created_at";
    protected $updateTime = "updated_at";
    public $autoWriteTimestamp = true;
	/*
	 * 商品分销信息
	 * */
	public function getGoodsAttr($value,$data)
	{
		$data = Goods::field('id,commission_charge_type,commission_charge_first,commission_charge_second')->where('id',$data['goods_id'])->find()->toArray();
		return $data;
	}
	public function getMemberInfoAttr($value,$data){
	    return OrderMemberInfo::where("order_goods_id",$data['id'])->field('id,username,id_number,phone')->find();
    }

}
